package com.haibei.adapter.bean;

import java.util.ArrayList;

import com.common.bean.IBeanInterface;

/**
 * @author zhanglei
 * @desc 评论(资讯/话题)
 */
public class Comment implements IBeanInterface {

	private static final long serialVersionUID = 5247833029399686982L;

	public static final int ARTICLE_COMMENT = 1;
	public static final int TOPIC_COMMENT = 2;

	public static final int DEFAULT_PARENT_ID = 0;

	private String id;
	/** parentId=0 表示一级评论，反之二级评论，parentId=关联的一级评论ID */
	private String parentId;

	/** 会员ID */
	private String uid;

	/** 关联文章的ID，(资讯/话题ID) */
	private String relationId;

	/** 1:资讯评论; 2:话题评论 */
	private String type;

	/** 评论内容 */
	private String content;

	/** 评论赞数 */
	private String praise;

	/** 评论会员 */
	private User user;

	private String time;

	private boolean isHot;
	/** 二级评论 */
	private ArrayList<Comment> subComment;

	public Comment() {
		subComment=new ArrayList<Comment>();
	}
	public String getId() {
		return id;
	}

	public void addParse(){
		this.praise=String.valueOf(Integer.parseInt(this.praise)+1);
	}
	public boolean isHot() {
		return isHot;
	}

	public void setHot(boolean isHot) {
		this.isHot = isHot;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getUid() {
		return uid;
	}

	public void setUid(String uid) {
		this.uid = uid;
	}

	public String getRelationId() {
		return relationId;
	}

	public void setRelationId(String relationId) {
		this.relationId = relationId;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getPraise() {
		return praise;
	}

	public void setPraise(String praise) {
		this.praise = praise;
	}

	public User getUser() {
		return user;
	}

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public ArrayList<Comment> getSubComment() {
		return subComment;
	}
	public void addSubComment(Comment coment){
		this.subComment.add(coment);
	}

}